display = ["1111110", "0110000", "1101101", "1111001", "0110011", "1011011", "1011111", "1110000", "1111111", "1111011"]
could_leaded = [[] for _ in range(1 << 7)]  # 每个数字可能由哪些数字熄灭得到


def f(a, b):
    for k in range(7):
        if a[k] == b[k] or (b[k] == '1' and a[k] == '0'):
            pass
        else:
            return False
    return True


def num2bin(num):
    t = bin(num)[2:]
    return f"{'0' * (7 - len(t))}{t}"


for i in range(1 << 7):
    for j in range(10):
        # if i == j:continue
        if f(num2bin(i), display[j]):
            could_leaded[i].append(j)
print()
cccccc = """0000011
1001011
0000001
0100001
0101011
0110110
1111111
0010110
0101001
0010110
1011100
0100110
1010000
0010011
0001111
0101101
0110101
1101010""".split()
ans = 1
for c in cccccc:
    ans *= len(could_leaded[int(c, 2)])
print(ans)
